package com.example.mysqlsearchdemo.entities;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

@Entity
@Data
@DynamicInsert
@DynamicUpdate
@Table(indexes = {
        @Index(columnList = "userId")
})
public class Prize extends BaseEntity {
    @Column(columnDefinition = "varchar(32) not null default '' comment '礼品名称'")
    private String prizeName;

    @Column(columnDefinition = "int(11) not null default 0 comment '用户ID'")
    private long userId;

    @Transient
    private User user;

    @Transient
    private String userName;
}
